home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # --------------------------------------------------------------------------
- # Copyright 1992 by Forschungszentrum Informatik (FZI)
- #
- # You can use and distribute this software under the terms of the licence
- # you should have received along with this program.
- # If not or if you want additional information, write to
- # Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
- # D-7500 Karlsruhe 1, Germany.
- # --------------------------------------------------------------------------
- # 'sos-cct - 27:02:91 - Dietmar Theobald'
- #
- # sos-cct [-l [<delay>]]
- #
- # Clean container directory: remove empty containers and squeeze nonempty ones
- # in $SOSCONTAINER.
- # If the option '-l' is enabled the removal/squeeze is repeated every <delay>
- # seconds. The default value for <delay> is 300s, i.e. 5min.
- #
-
- BINDIR=${SOSPATH-__SOS_INSTALLED_PATH__}/bin/
-
- cd ${SOSCONTAINER?}
-
- [ "$1" = '-l' ] && { loop='+'; shift
- if [ $# -gt 0 ] ; then
- delay="$1"; shift
- else
- delay='3600'
- fi
- }
-
- [ $# -gt 0 ] && { echo >&2 '*** usage: sos-cct [-l]'; exit 1 ;}
-
- while true
- do
- for cnt in [0-9]*
- do
- [ -f "$cnt" ] && {
- ${BINDIR}cnt -t -d $cnt 2> /dev/null
- ${BINDIR}cnt -t -s $cnt 2> /dev/null
- }
- done
-
- [ "$loop" ] || break
-
- sleep $delay
- done
-